package com.test.license;


import com.test.Protection.A;

/**
 * @author: zouren
 * @date: 2022/3/11
 * @description:  license 校验类
 * LCheck-》A
 */
public class LCheck {
    private static LCheck instance = new LCheck();
    private A a = new A();
    private long checkDate = System.currentTimeMillis();
    //25分钟检查一次 900000L
    private long checkInterval = 10000L;

    public static LCheck getInstance() {
        if(instance==null){
            instance = new LCheck();
        }
        return instance;
    }


    /**
     * 校验
     * @param refresh
     */
    public synchronized boolean check(boolean refresh) {
        this.checkDate = System.currentTimeMillis();
        return this.a.checkLicense(refresh);
    }

    public long getCheckDate() {
        return checkDate;
    }

    public long getCheckInterval() {
        return checkInterval;
    }
}
